package Dao;

import Util.PwDSM;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.sql.SQLException;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;

public class UserDAO extends GenericDAO{
    
    
    public void addUser(String nome, String login, String senha) throws SQLException, BadPaddingException, NoSuchPaddingException, IllegalBlockSizeException, InvalidKeyException, NoSuchAlgorithmException, InvalidAlgorithmParameterException{
        System.out.println(senha);
        String senhaCriptografada = PwDSM.encrypt(senha);
        System.out.println(senhaCriptografada);
        String query = "exec sp_cadastrarUsuario ?, ?, ?"; //nome, login, senha
        executeCommand(query, nome, login, senhaCriptografada);
    }
    
}
 